<template>
	<view class="ys">
		<view class="formbox">
			<view class="title">
				*请填写正确的手机号以确保能收到短信
			</view>

			<view class="inputli">
				<text>手机号</text>
				<uni-easyinput type="number" v-model="phone" placeholder="请输入手机号"></uni-easyinput>
			</view>
			<view class="inputli">
				<text>验证码</text>
				<uni-easyinput v-model="code" placeholder="请输入验证码"></uni-easyinput>
				<button class="code" @click="getCode" v-if="!is_send">获取验证码</button>
				<button class="code" v-else>{{time}}s</button>
			</view>
			<button>提交</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				phone: '',
				code: '',
				time: '60',
				timer: '',
				is_send: false
			}
		},
		onLoad() {

		},
		methods: {

		}
	}
</script>

<style lang="scss">
	page {
		background: #f2f2f2;
		padding-top: 10px;
	}

	.title {
		color: #f00;
		font-size: 12px;
		margin-bottom: 20px;
	}

	.formbox {
		padding: 20px 10px;
		box-sizing: border-box;
		font-size: 14px;
		background: #fff;
		border-radius: 10px;
		width: 96%;
		margin: 0 auto;

		.inputli {
			display: flex;
			align-items: center;
			margin-bottom: 15px;
			position: relative;

			text {
				display: block;
				width: 70px;
			}

			.code {
				color: #00ADEC;
				background: transparent;
				font-size: 12px;
				margin: 0;
				padding: 0;
				position: absolute;
				right: 0;
				width: 100px;
				text-align: center;

				&::after {
					border: 0;
				}
			}
		}
	}

	button {
		background: #00ADEC;
		font-size: 15px;
		margin-top: 30px;
		width: 50%;
		color: #fff;
	}
</style>